package com.jt.consumer.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @FeignClient 注解描述的接口，用于定义远程调用规范
 * 其中，name属性的值为远端调用的服务名，同时也会将这个名字作为
 * RemoteProviderService接口实现类的对象的Bean名字。
 * */
@FeignClient(name = "sca-provider",
        contextId = "remoteProviderService",
        fallbackFactory = ProviderFallBackFactory.class)//sca-provider为nocas中的服务名
public interface RemoteProviderService {
    @GetMapping("/provider/echo/{msg}")
    String echoMessage(@PathVariable("msg") String msg);
}
